/**************************************************************
Arise Engine		EditorMaterialImport.h

					E-mail:	arise_engine@mail.ru

created:			09.03.2007
last changes:		10.03.2007
**************************************************************/
#pragma once

#include "..\engine\BaseObject.h" 
#include "EditorMaterial.h"


struct EditorTextureData
{
	std::string map_name;
};


class RawMaterial: public BaseObject
{
private:

	UINT	m_class;

	void AddSubmaterialToList(std::vector<EditorMaterial> &submaterials_list);
	void TransferMaterialData(EditorMaterial &material);
	
public:
	RawMaterial();
	virtual ~RawMaterial();

	enum
	{
		CLASS_STANDART			= 0,
		CLASS_MULTI_SUBOBJECT	= 1,
		CLASS_TOP_BOTTOM		= 2,
		CLASS_MATTE_SHADOW		= 3,
	};

	std::vector<RawMaterial>		m_children;
	std::vector<EditorMaterial>		m_submaterials;

	std::string m_diffuse_map_name;
	std::string m_ambient_map_name;
	std::string m_opacity_map_name;
	float m_transparency;


	void Init();
	void Update();
	void PreProcess();
	void Release();

	void AddSubmaterial(RawMaterial material){m_children.push_back(material);}

	void SetClass(UINT mat_class)	{m_class = mat_class;}

	bool IsClassStandart()			{return (m_class == CLASS_STANDART);}
	bool IsClassMultiSubObject()	{return (m_class == CLASS_MULTI_SUBOBJECT);}
	EditorMaterial* GetSubMaterial(UINT sub_mat_id){if(sub_mat_id < 0 || sub_mat_id >= m_submaterials.size())return 0; return &m_submaterials[sub_mat_id];}

};




